\hypertarget{classduye_1_1_system}{\section{duye\-:\-:System Class Reference}
\label{classduye_1_1_system}\index{duye\-::\-System@{duye\-::\-System}}
}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{classduye_1_1_system_a34a0c177baf9520260cf855b2efca320}{sleep} (const uint64 \&time)
\begin{DoxyCompactList}\small\item\em sleep \end{DoxyCompactList}\item 
static void \hyperlink{classduye_1_1_system_a56336951deb64c0dd577fdc301fd569a}{msleep} (const uint64 \&time)
\begin{DoxyCompactList}\small\item\em usleep \end{DoxyCompactList}\item 
static void \hyperlink{classduye_1_1_system_ae86ab2172d0e2ac3320ac576f4424b6d}{usleep} (const uint64 \&time)
\begin{DoxyCompactList}\small\item\em usleep \end{DoxyCompactList}\item 
static int64 \hyperlink{classduye_1_1_system_ae84745d111fd169d7d6befe9143d8062}{pformat} (int8 $\ast$buffer, const uint64 size, const int8 $\ast$args,...)
\begin{DoxyCompactList}\small\item\em format \end{DoxyCompactList}\item 
static int32 \hyperlink{classduye_1_1_system_ade33f02d88f61f508301d265d6690c54}{shell} (const int8 $\ast$cmd, int8 $\ast$result, const uint32 result\-\_\-size)
\begin{DoxyCompactList}\small\item\em execute shell command \end{DoxyCompactList}\item 
static int32 \hyperlink{classduye_1_1_system_a5fbd814b0c5c30f2904253a56e060ef2}{shell} (const int8 $\ast$cmd,...)
\begin{DoxyCompactList}\small\item\em execute shell command \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_system_a2daa2b5ce18cb47141b0d15743cd2e77}{static int32 {\bfseries shell} (const uint32 cmd\-\_\-len, const int8 $\ast$cmd,...)}\label{classduye_1_1_system_a2daa2b5ce18cb47141b0d15743cd2e77}

\item 
\hypertarget{classduye_1_1_system_a8fd304957c39052dcabe01a5559a08df}{static int32 {\bfseries shell} (std\-::string \&result, const int8 $\ast$cmd,...)}\label{classduye_1_1_system_a8fd304957c39052dcabe01a5559a08df}

\item 
\hypertarget{classduye_1_1_system_aba465a38cf0615bd2f6cc36b7275c4be}{static int32 {\bfseries shell} (const uint32 cmd\-\_\-len, std\-::string \&result, const int8 $\ast$cmd,...)}\label{classduye_1_1_system_aba465a38cf0615bd2f6cc36b7275c4be}

\item 
\hypertarget{classduye_1_1_system_afce55eb8a1a5161f39650c37400d737e}{static int32 {\bfseries shell} (const uint32 cmd\-\_\-len, int8 $\ast$result, const uint32 result\-\_\-size, const int8 $\ast$cmd,...)}\label{classduye_1_1_system_afce55eb8a1a5161f39650c37400d737e}

\item 
static uint64 \hyperlink{classduye_1_1_system_a5cfffdc8f55b93cd90dcea184f4fa73c}{sys\-Time} ()
\begin{DoxyCompactList}\small\item\em get system time \end{DoxyCompactList}\item 
static bool \hyperlink{classduye_1_1_system_a9c3cea2a5f53d80af2d5be0d96634e1e}{opt\-Arg} (int32 argc, int8 $\ast$$\ast$argv, int8 $\ast$cmd, int64 \&value)
\begin{DoxyCompactList}\small\item\em get options \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_system_a24ddbb3c5ef52e0e15088f76b12d1bbf}{static bool {\bfseries opt\-Arg} (int32 argc, int8 $\ast$$\ast$argv, int8 $\ast$cmd, uint64 \&value)}\label{classduye_1_1_system_a24ddbb3c5ef52e0e15088f76b12d1bbf}

\item 
\hypertarget{classduye_1_1_system_ad6a4be23753262aaca0a2c28663a6ef6}{static bool {\bfseries opt\-Arg} (int32 argc, int8 $\ast$$\ast$argv, int8 $\ast$cmd, std\-::string \&value)}\label{classduye_1_1_system_ad6a4be23753262aaca0a2c28663a6ef6}

\item 
\hypertarget{classduye_1_1_system_a2bf2b10079ceb4a379f08d4ca69b1dac}{static void \hyperlink{classduye_1_1_system_a2bf2b10079ceb4a379f08d4ca69b1dac}{daemonize} ()}\label{classduye_1_1_system_a2bf2b10079ceb4a379f08d4ca69b1dac}

\begin{DoxyCompactList}\small\item\em create daemon process \end{DoxyCompactList}\item 
static bool \hyperlink{classduye_1_1_system_ad951d255082cdd895661295fe5fe485b}{limit\-Cpu} (const char $\ast$process\-\_\-name, const uint16 cpu\-\_\-percent)
\begin{DoxyCompactList}\small\item\em limit process C\-P\-U resource usage \end{DoxyCompactList}\item 
static bool \hyperlink{classduye_1_1_system_acdcfcee85cd31b4a304f5a4b0f4a942d}{get\-I\-P\-Addr\-By\-Dev\-Name} (const std\-::string \&phy\-Card\-Name, std\-::string \&ip\-Addr)
\begin{DoxyCompactList}\small\item\em get ip address by physical network card name \end{DoxyCompactList}\item 
static bool \hyperlink{classduye_1_1_system_a824e5cb2140bfacab490ca4ce6f507d9}{get\-First\-Valid\-I\-P\-Addr} (std\-::string \&ip\-Addr)
\begin{DoxyCompactList}\small\item\em get first valid ip address \end{DoxyCompactList}\item 
static bool \hyperlink{classduye_1_1_system_ad0e93f80d358761e4d27665f4a919012}{get\-Network\-Cards} (std\-::map$<$ std\-::string, std\-::string $>$ \&network\-Cards)
\begin{DoxyCompactList}\small\item\em get first valid ip address \end{DoxyCompactList}\item 
static uint32 \hyperlink{classduye_1_1_system_ac54f9077e03b9de605e0ab8262cb59ee}{get\-Pid} ()
\begin{DoxyCompactList}\small\item\em get process id \end{DoxyCompactList}\item 
static uint32 \hyperlink{classduye_1_1_system_a112533aa2a23327bd618f85ef344db13}{get\-P\-Pid} ()
\begin{DoxyCompactList}\small\item\em get parent process id \end{DoxyCompactList}\item 
static bool \hyperlink{classduye_1_1_system_a9f14e6cba9ea13261c1ce55a56810147}{get\-Sys\-Info} (std\-::string \&name, std\-::string \&version)
\begin{DoxyCompactList}\small\item\em get system type and version \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_system_a851da139fe28a68d35ba3e9d86a3beaa}{static void \hyperlink{classduye_1_1_system_a851da139fe28a68d35ba3e9d86a3beaa}{man\-Malloc} ()}\label{classduye_1_1_system_a851da139fe28a68d35ba3e9d86a3beaa}

\begin{DoxyCompactList}\small\item\em manual free system memory fragmentation \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_system_a824e5cb2140bfacab490ca4ce6f507d9}{\index{duye\-::\-System@{duye\-::\-System}!get\-First\-Valid\-I\-P\-Addr@{get\-First\-Valid\-I\-P\-Addr}}
\index{get\-First\-Valid\-I\-P\-Addr@{get\-First\-Valid\-I\-P\-Addr}!duye::System@{duye\-::\-System}}
\subsubsection[{get\-First\-Valid\-I\-P\-Addr}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-System\-::get\-First\-Valid\-I\-P\-Addr (
\begin{DoxyParamCaption}
\item[{std\-::string \&}]{ip\-Addr}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_a824e5cb2140bfacab490ca4ce6f507d9}


get first valid ip address 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em ip\-Addr} & \-: ip address \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_acdcfcee85cd31b4a304f5a4b0f4a942d}{\index{duye\-::\-System@{duye\-::\-System}!get\-I\-P\-Addr\-By\-Dev\-Name@{get\-I\-P\-Addr\-By\-Dev\-Name}}
\index{get\-I\-P\-Addr\-By\-Dev\-Name@{get\-I\-P\-Addr\-By\-Dev\-Name}!duye::System@{duye\-::\-System}}
\subsubsection[{get\-I\-P\-Addr\-By\-Dev\-Name}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-System\-::get\-I\-P\-Addr\-By\-Dev\-Name (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{phy\-Card\-Name, }
\item[{std\-::string \&}]{ip\-Addr}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_acdcfcee85cd31b4a304f5a4b0f4a942d}


get ip address by physical network card name 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em phy\-Card\-Name} & \-: physical network card name \\
\hline
\mbox{\tt out}  & {\em ip\-Addr} & \-: ip address \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_ad0e93f80d358761e4d27665f4a919012}{\index{duye\-::\-System@{duye\-::\-System}!get\-Network\-Cards@{get\-Network\-Cards}}
\index{get\-Network\-Cards@{get\-Network\-Cards}!duye::System@{duye\-::\-System}}
\subsubsection[{get\-Network\-Cards}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-System\-::get\-Network\-Cards (
\begin{DoxyParamCaption}
\item[{std\-::map$<$ std\-::string, std\-::string $>$ \&}]{network\-Cards}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_ad0e93f80d358761e4d27665f4a919012}


get first valid ip address 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em network\-Cards} & \-: $<$network\-\_\-card\-\_\-name, ip\-\_\-address$>$ \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_ac54f9077e03b9de605e0ab8262cb59ee}{\index{duye\-::\-System@{duye\-::\-System}!get\-Pid@{get\-Pid}}
\index{get\-Pid@{get\-Pid}!duye::System@{duye\-::\-System}}
\subsubsection[{get\-Pid}]{\setlength{\rightskip}{0pt plus 5cm}static uint32 duye\-::\-System\-::get\-Pid (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_ac54f9077e03b9de605e0ab8262cb59ee}


get process id 

\begin{DoxyReturn}{Returns}
process id 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_a112533aa2a23327bd618f85ef344db13}{\index{duye\-::\-System@{duye\-::\-System}!get\-P\-Pid@{get\-P\-Pid}}
\index{get\-P\-Pid@{get\-P\-Pid}!duye::System@{duye\-::\-System}}
\subsubsection[{get\-P\-Pid}]{\setlength{\rightskip}{0pt plus 5cm}static uint32 duye\-::\-System\-::get\-P\-Pid (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_a112533aa2a23327bd618f85ef344db13}


get parent process id 

\begin{DoxyReturn}{Returns}
process id 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_a9f14e6cba9ea13261c1ce55a56810147}{\index{duye\-::\-System@{duye\-::\-System}!get\-Sys\-Info@{get\-Sys\-Info}}
\index{get\-Sys\-Info@{get\-Sys\-Info}!duye::System@{duye\-::\-System}}
\subsubsection[{get\-Sys\-Info}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-System\-::get\-Sys\-Info (
\begin{DoxyParamCaption}
\item[{std\-::string \&}]{name, }
\item[{std\-::string \&}]{version}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_a9f14e6cba9ea13261c1ce55a56810147}


get system type and version 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em name} & \-: system type, content \-: ubuntu, centos, fedora, rhel, suse, asianux, debian, oraclelinux \\
\hline
\mbox{\tt out}  & {\em version} & \-: system version \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false/true 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_ad951d255082cdd895661295fe5fe485b}{\index{duye\-::\-System@{duye\-::\-System}!limit\-Cpu@{limit\-Cpu}}
\index{limit\-Cpu@{limit\-Cpu}!duye::System@{duye\-::\-System}}
\subsubsection[{limit\-Cpu}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-System\-::limit\-Cpu (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{process\-\_\-name, }
\item[{const uint16}]{cpu\-\_\-percent}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_ad951d255082cdd895661295fe5fe485b}


limit process C\-P\-U resource usage 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em process\-\_\-name} & \-: process name \\
\hline
\mbox{\tt in}  & {\em cpu\-\_\-percent} & \-: C\-P\-U limit percent \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_a56336951deb64c0dd577fdc301fd569a}{\index{duye\-::\-System@{duye\-::\-System}!msleep@{msleep}}
\index{msleep@{msleep}!duye::System@{duye\-::\-System}}
\subsubsection[{msleep}]{\setlength{\rightskip}{0pt plus 5cm}static void duye\-::\-System\-::msleep (
\begin{DoxyParamCaption}
\item[{const uint64 \&}]{time}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_a56336951deb64c0dd577fdc301fd569a}


usleep 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em time} & \-: millisecond \\
\hline
\end{DoxyParams}
\hypertarget{classduye_1_1_system_a9c3cea2a5f53d80af2d5be0d96634e1e}{\index{duye\-::\-System@{duye\-::\-System}!opt\-Arg@{opt\-Arg}}
\index{opt\-Arg@{opt\-Arg}!duye::System@{duye\-::\-System}}
\subsubsection[{opt\-Arg}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-System\-::opt\-Arg (
\begin{DoxyParamCaption}
\item[{int32}]{argc, }
\item[{int8 $\ast$$\ast$}]{argv, }
\item[{int8 $\ast$}]{cmd, }
\item[{int64 \&}]{value}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_a9c3cea2a5f53d80af2d5be0d96634e1e}


get options 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em argc} & \-: argument count \\
\hline
\mbox{\tt in}  & {\em argv} & \-: argument list \\
\hline
\mbox{\tt in}  & {\em cmd} & \-: need parser command \\
\hline
\mbox{\tt out}  & {\em value} & \-: out value \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_ae84745d111fd169d7d6befe9143d8062}{\index{duye\-::\-System@{duye\-::\-System}!pformat@{pformat}}
\index{pformat@{pformat}!duye::System@{duye\-::\-System}}
\subsubsection[{pformat}]{\setlength{\rightskip}{0pt plus 5cm}static int64 duye\-::\-System\-::pformat (
\begin{DoxyParamCaption}
\item[{int8 $\ast$}]{buffer, }
\item[{const uint64}]{size, }
\item[{const int8 $\ast$}]{args, }
\item[{}]{...}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_ae84745d111fd169d7d6befe9143d8062}


format 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em buffer} & \-: out buffer \\
\hline
\mbox{\tt in}  & {\em size} & \-: out buffer size \\
\hline
\mbox{\tt in}  & {\em args} & \-: parameters \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
string size, error \-: -\/1 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_ade33f02d88f61f508301d265d6690c54}{\index{duye\-::\-System@{duye\-::\-System}!shell@{shell}}
\index{shell@{shell}!duye::System@{duye\-::\-System}}
\subsubsection[{shell}]{\setlength{\rightskip}{0pt plus 5cm}static int32 duye\-::\-System\-::shell (
\begin{DoxyParamCaption}
\item[{const int8 $\ast$}]{cmd, }
\item[{int8 $\ast$}]{result, }
\item[{const uint32}]{result\-\_\-size}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_ade33f02d88f61f508301d265d6690c54}


execute shell command 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em cmd} & \-: shell command \\
\hline
\mbox{\tt out}  & {\em result} & \-: output buffer \\
\hline
\mbox{\tt in}  & {\em result\-\_\-size} & \-: output buffer size \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\-: On success, return the number of read bytes. The number equals to zero when shell execute print empty. or -\/1 if an error occurred. 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_a5fbd814b0c5c30f2904253a56e060ef2}{\index{duye\-::\-System@{duye\-::\-System}!shell@{shell}}
\index{shell@{shell}!duye::System@{duye\-::\-System}}
\subsubsection[{shell}]{\setlength{\rightskip}{0pt plus 5cm}static int32 duye\-::\-System\-::shell (
\begin{DoxyParamCaption}
\item[{const int8 $\ast$}]{cmd, }
\item[{}]{...}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_a5fbd814b0c5c30f2904253a56e060ef2}


execute shell command 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em cmd\-\_\-len} & \-: command length \\
\hline
\mbox{\tt out}  & {\em result} & \-: output buffer \\
\hline
\mbox{\tt in}  & {\em result\-\_\-size} & \-: output buffer size \\
\hline
\mbox{\tt in}  & {\em cmd} & \-: cmd \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\-: On success, return the number of read bytes. The number equals to zero when shell execute print empty. or -\/1 if an error occurred. 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_a34a0c177baf9520260cf855b2efca320}{\index{duye\-::\-System@{duye\-::\-System}!sleep@{sleep}}
\index{sleep@{sleep}!duye::System@{duye\-::\-System}}
\subsubsection[{sleep}]{\setlength{\rightskip}{0pt plus 5cm}static void duye\-::\-System\-::sleep (
\begin{DoxyParamCaption}
\item[{const uint64 \&}]{time}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_a34a0c177baf9520260cf855b2efca320}


sleep 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em time} & \-: second \\
\hline
\end{DoxyParams}
\hypertarget{classduye_1_1_system_a5cfffdc8f55b93cd90dcea184f4fa73c}{\index{duye\-::\-System@{duye\-::\-System}!sys\-Time@{sys\-Time}}
\index{sys\-Time@{sys\-Time}!duye::System@{duye\-::\-System}}
\subsubsection[{sys\-Time}]{\setlength{\rightskip}{0pt plus 5cm}static uint64 duye\-::\-System\-::sys\-Time (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_a5cfffdc8f55b93cd90dcea184f4fa73c}


get system time 

\begin{DoxyReturn}{Returns}
time(microsecond) 
\end{DoxyReturn}
\hypertarget{classduye_1_1_system_ae86ab2172d0e2ac3320ac576f4424b6d}{\index{duye\-::\-System@{duye\-::\-System}!usleep@{usleep}}
\index{usleep@{usleep}!duye::System@{duye\-::\-System}}
\subsubsection[{usleep}]{\setlength{\rightskip}{0pt plus 5cm}static void duye\-::\-System\-::usleep (
\begin{DoxyParamCaption}
\item[{const uint64 \&}]{time}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_system_ae86ab2172d0e2ac3320ac576f4424b6d}


usleep 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em time} & \-: microsecond \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/system/\hyperlink{duye__sys_8h}{duye\-\_\-sys.\-h}\end{DoxyCompactItemize}
